﻿using Microsoft.AspNetCore.Mvc;
using studentSubsidy.Entity;
using studentSubsidy.Service;

namespace studentSubsidy.Controllers
{
    [ApiController]
    [Route("api/financial/[Action]")]
    public class FinancialController: Controller
    {
        private FinancialService  _financialService = new FinancialService();
        
        [HttpGet(Name = "getNeedToPayment")]
        public Result GetNeedToPayment([FromQuery] int userId)
        {
            return _financialService.getNeedToPayment(userId);
        }
        
        [HttpGet(Name = "getHasPayment")]
        public Result GetHasPayment([FromQuery] int userId)
        {
            return _financialService.getHasPaymentList(userId);
        }
        
        [HttpGet(Name = "getNeedDueList")]
        public Result GetNeedDueList([FromQuery] int userId)
        {
            return _financialService.getNeedDueList(userId);
        }
        
        [HttpPost(Name = "paymentDue")]
        public Result PaymentDue([FromQuery] int refundLogId)
        {
            return _financialService.PaymentDue(refundLogId);
        }
        
        [HttpGet(Name = "getFinishProject")]
        public Result GetFinishProject([FromQuery] int userId)
        {
            return _financialService.getFinishProject(userId);
        }
    }
}